import axios from 'axios';

const axiosInstance = axios.create({
    timeout:6000
});

type Method = 'get' | 'post';

// ?表示可以不用传入这个数据
export const request = (method:Method,url:string,data?:any) => {
    console.log('方法：',method,'url:',url);
    
    if(method === 'post') {
        console.log('post---_');
        
        axios.post(url);

        return axios.post(url,{
            name:'daxoa',
            age:18
        });

    }
}